package com.yequan.thread.threadpool.simple;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author yq
 * @date 2020/05/14
 */
public class Test {

    private static AtomicInteger count = new AtomicInteger(0);

    public static void main(String[] args) {
        TimingThreadPool threadPool = new TimingThreadPool();
        for (int i = 0; i < 10; i++) {
            threadPool.execute(() -> {
                try {
                    Thread.sleep(1000);
                    System.out.println("输出。。。。。" + count.incrementAndGet());
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            });
        }
    }

}
